<%-- 
    Document   : groupfood
    Created on : Jan 5, 2012, 2:20:03 PM
    Author     : VIC
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">
<%@page import="Beans.*,java.util.*,Models.*,java.text.NumberFormat"%>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <%
        NumberFormat nf = NumberFormat.getNumberInstance(Locale.FRENCH);
        String loai = request.getParameter("loai");
        String nhom = request.getParameter("nhom");
        String tenma = request.getParameter("tenma");
        String start = request.getParameter("start");
        int langid = (Integer) session.getAttribute("langid");
        String dsts = "'selecttb','accep','skip','saleoff'"; // chuỗi chứa các mã tham số của trang này.
        ThamSoHT[] mdsts = ThamSoHT_Model.DSThamSo(dsts, langid); // mảng chứa các tham số của trang này.
        String accep = mdsts[0].getTenTS();
        String saleoff = mdsts[1].getTenTS();
        String selecttb = mdsts[2].getTenTS();
        String skip = mdsts[3].getTenTS();
        Vector v = MonAn_Model.LoadMonAn(langid, nhom, loai,tenma, start);
        int n = v.size();
        for(int i=0;i<n ;i++)
                {
                    String[] monan = (String[]) v.get(i);
            %>
            <div class="foodimg"><img onclick="Zoom('<%=monan[4] %>','<%=monan[5] %>','<%=skip %>');" src="images/foodimages/mobile/<%=monan[4] %>"/> </div>
            
                            <div class="foodinfo" >
                                    <table>
                                        <tr><td colspan="3" style="color: #FFE689;"><p><%=monan[1] %></p></td></tr>
                                        <tr>
                                            <td colspan="3"><%=nf.format(Double.parseDouble(monan[6])) %> / <%=monan[3] %></td>
                                        </tr>
                                        <% int soff = MonAn_Model.LoadGiamGia(monan[0]);
                                            if(soff != 0) {
                                        %>
                                        <tr><td colspan="3"><%=saleoff %>: <%=soff %>%</td> </tr>
                                        <% }%>
                                    <tr>
                                        <td id="<%=monan[0]+monan[2] %>">
                                            <img onclick="GoiMon('<%=selecttb %>','<%=accep %>','<%=monan[0] %>','<%=monan[1] %>','<%=monan[2] %>','<%=monan[3] %>','<%=monan[4] %>','<%=monan[6] %>');"  src="images/plus1.png"/>
                                        </td>
                                        
                                    </tr>
                                    </table>
                                
                            </div>
             <% } %>
    </body>
</html>
